﻿using System;
using System.Data;
using CrystalDecisions.CrystalReports.Engine;

namespace ContractManagementSystem.Presentation.ReportManagement
{
    public partial class ShowReportContract1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["SOURCE_CONTRACT_TABLE"] != null)
            {
                var reportDocument = new ReportDocument();

                reportDocument.Load(Server.MapPath("CrystalReportContract.rpt"));

                var dataTable = (DataTable)Session["SOURCE_CONTRACT_TABLE"];
                reportDocument.SetDataSource(dataTable);

                CrystalReportViewerContract.DisplayGroupTree = false;
                CrystalReportViewerContract.ReportSource = reportDocument;
                CrystalReportViewerContract.DataBind();
                CrystalReportViewerContract.RefreshReport();
            }
        }
    }
}
